/**
 * 项目日志
 */
let event = Promise.resolve((r)=>setTimeout(r))
let style = 'border: 1px #000 solid;font-size:10px;padding: 2px 5px;border-radius: 5px;background-color: #333;color: #F0AD4E;'
export const log = (...text) => {
	let perlogtext = uni.$ht.config.perlogtext || ''
	if (uni.$ht.config.silent) {
		event.then((r)=>r(console.log.bind(console,`%c${perlogtext}`,style,...text)))
	}
}
export const error = (...text) => {
	let perlogtext = uni.$ht.config.perlogtext || ''
	if (uni.$ht.config.silent) {
		event.then((r)=>r(console.error.bind(console,`%c${perlogtext}`,style,...text)))
	}
}
export const warn = (...text) => {
	let perlogtext = uni.$ht.config.perlogtext || ''
	if (uni.$ht.config.silent) {
		event.then((r)=>r(console.warn.bind(console,`%c${perlogtext}`,style,...text)))
	}
}
export const info = (...text) => {
	let perlogtext = uni.$ht.config.perlogtext || ''
	if (uni.$ht.config.silent) {
		event.then((r)=>r(console.info.bind(console,`%c${perlogtext}`,style,...text)))
	}
}